package com.gxitsky.classload.demo1;

import org.reflections.vfs.Vfs;

import java.net.URL;

/**
 * @author gxing
 * @desc 扫描容器地址
 * @date 2021/12/28
 */
public class ContainerType implements Vfs.UrlType {

    Vfs.Dir dir;

    public ContainerType(Vfs.Dir dir) {
        this.dir = dir;
    }

    @Override
    public boolean matches(URL url) throws Exception {
        return url.getProtocol().contains(ContainerApp.CONTAINER_TYPE);
    }

    @Override
    public Vfs.Dir createDir(URL url) throws Exception {
        return dir;
    }

}
